package com.abase.site.server.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import com.abase.site.server.GuiceModule;
import com.abase.site.server.ServiceFactory;
import com.google.inject.Guice;
import com.google.inject.Injector;

public class GuiceBootstrap extends HttpServlet {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3209334624030222911L;
	
	//
	// Initialise l'injector
	//
	
	@Override
	public void init() throws ServletException {
		
		Injector injector = Guice.createInjector(new GuiceModule());
		
		ServiceFactory factory = ServiceFactory.getInstance();
		injector.injectMembers(factory);
		
	}

}
